package com.yzy.fly.mapper;

import com.yzy.fly.entity.role.FlyDefModel;
import com.yzy.fly.kernel.mapper.FlyBasicMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;

@Mapper
public interface FlyDefModelMapper extends FlyBasicMapper<FlyDefModel> {

    @Select("select * from fly_def_model a where 1=1 ")
    List<FlyDefModel> selectAllList();

    @Select("select * from fly_def_model a where 1=1 and a.systemId = #{systemId}")
    List<FlyDefModel> selectAllBySystemId(@Param("systemId") Integer systemId);

//    @Select("select * from fly_def_model a where 1=1 and a.parentId = #{parentId} and a.systemId = #{systemId}")
//    List<FlyDefModel> selectAllByParentIdAndSystemId(@Param("parentId") Integer parentId, @Param("systemId") Integer systemId);

//    @Select("select * from fly_def_model a where 1=1 and (a.id = #{parentId} or a.parentId = #{parentId}) and a.systemId = #{systemId}")
//    List<FlyDefModel> selectAllByParentIdAndSystemId_ContainsId(@Param("parentId") Integer parentId, @Param("systemId") Integer systemId);


    /**
     * 批量插入（mysql）
     * @param entityList
     * @return
     */
    Integer insertBatchSomeColumn(Collection<FlyDefModel> entityList);



}
